@extends('layouts.userctl')
@section('content')
<style>
	.formpage {
		width: 60%;
		height: auto;
		margin: 10px auto;
	}

	.layui-form-label {
		width: 150px;
	}

	.layui-input-block {
		margin-left: 150px;
	}
</style>
<div class="formpage">
	<form class="layui-form" action="{{route('admin.user.depedit',['id'=>$dep->id])}}" method="post"
		onkeypress="return event.keyCode != 13;">
		{{csrf_field()}}
		<div class="layui-form-item">
			<label class="layui-form-label">部门名称</label>
			<div class="layui-input-block">
				<input type="text" name="department" required lay-verify="required" placeholder="请填写部门名称"
					autocomplete="off" class="layui-input" value="{{$dep->department}}">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">备注信息</label>
			<div class="layui-input-block">
				<input type="text" name="remark" required lay-verify="required" placeholder="选填:部门备注信息"
					autocomplete="off" class="layui-input" value="{{$dep->remark}}">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">确认修改</button>
				<a href="{{ url()->previous()}}" class="layui-btn layui-btn-primary" id="backpage">返  回</a>
			</div>
		</div>
	</form>
</div>
<script>
	//Demo
	layui.use('form', function() {
		var form = layui.form


	$('#backpage').click(function() {
			history.back(-1)
		})
		//监听提交
		form.on('submit(formDemo)', function(data) {
			var index = layer.load(0, { shade: false })
		})
	})
</script>

@endsection
